package org.dtrd.modules.ocr.entity.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.modules.ocr.entity.bean.OcrMappingTableDetail;


/**
 * <p>
 * 
 * </p>
 *
 * @author sun
 * @since 2022-09-07
 */
@Getter
@Setter
@TableName("dtrd_ent_rd_ocr_mapping_table")
public class DtrdEntRdOcrMappingTable {

    @TableId(value = "data_id", type = IdType.AUTO)
    private Integer dataId;

    /**
     * 表名
     */
    @TableField("title")
    private String title;

    /**
     * 表名
     */
    @TableField("table_name")
    private String tableName;

    @TableField("is_del")
    @TableLogic
    private Integer isDel;

    @TableField("create_time")
    private Date createTime;

    public DtrdEntRdOcrMappingTable init() {
        isDel = 0;
        createTime = new Date();
        return this;
    }

    public DtrdEntRdOcrMappingTable parseFromDto(OcrMappingTableDetail dto) {
        dataId = dto.getDataId();
        title = dto.getTitle();
        tableName = dto.getTableName();
        return this;
    }


}
